Merged
Conversation
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
bf1401c to
f3e760e
Compare
marcelklehr
requested changes
Dec 9, 2025
src/assistant.js
Outdated
| } | ||
| const url = generateUrl('/apps/assistant/config') | ||
| return axios.get(url, req) | ||
| return axios.get(url, req).data.catch(error => { |
Member
There was a problem hiding this comment.
This won't work, I think. axios.get returns a promise
Suggested change
| return axios.get(url, req).data.catch(error => { | |
| return axios.get(url, req).catch(error => { |
src/assistant.js
Outdated
|
|
||
| // fallback to the last used one | ||
| const selectedTaskTypeId = taskType ?? (await getLastSelectedTaskType())?.data | ||
| const selectedTaskTypeId = taskType ?? (await getLastSelectedTaskType()) |
Member
There was a problem hiding this comment.
Suggested change
| const selectedTaskTypeId = taskType ?? (await getLastSelectedTaskType()) | |
| const selectedTaskTypeId = taskType ?? (await getLastSelectedTaskType())?.data |
marcelklehr
reviewed
Dec 9, 2025
src/assistant.js
Outdated
| return axios.get(url, req).data.catch(error => { | ||
| if (error.response?.status === 404) { | ||
| console.debug(t('assistant', 'No last task type available, falling back to default')) | ||
| return 'chatty-llm' |
Member
There was a problem hiding this comment.
Suggested change
| return 'chatty-llm' | |
| return {data: 'chatty-llm'} |
Member
There was a problem hiding this comment.
Alternatively you could make the whole function async and await the axios.get call, use a try-catch to catch the error and return the value directly.
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
f3e760e to
af4f02a
Compare
Member
Author
|
Thanks, fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.